unit uChooseDate;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, Buttons;

type
  TfmChooseDate = class(TForm)
    DateTimePicker1: TDateTimePicker;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    DateTimePicker2: TDateTimePicker;
  private
    { Private declarations }
  public
    { Public declarations }
    Date : string;

    function Execute : boolean;
  end;

var
  fmChooseDate: TfmChooseDate;

implementation

{$R *.dfm}

{ TfmChooseDate }

function TfmChooseDate.Execute: boolean;
begin
  result := false;

  DateTimePicker1.DateTime := now;
  DateTimePicker2.DateTime := now;

  if ShowModal = mrOk then
  begin
    Date := FormatDateTime('dd.mm.yyyy', DateTimePicker1.Date) + FormatDateTime('hh:nn:ss', DateTimePicker2.Time);
    result := true;
  end;
end;

end.
